class XmlController < ApplicationController

  require 'xmlsimple'

  def generarxml
    @event=Event.all


    s = render_to_string :file => 'xml/events.xml.builder'
    File.open('Events.xml','w'){|f| f.write s}

    flash[:notice] = t('flash.xml')
    redirect_to :controller => :events,:action=>:index
  end


  def generarymostrarxml
    @event=Event.all


    s = render_to_string :file => 'xml/events.xml.builder'
    File.open('Events2.xml','w'){|f| f.write s}

    render 'xml/events.xml.builder'
  end

end
